package com.msf.common.utils;


import java.lang.reflect.Method;

public class InvokeUtils {

    public static <T> Object invokeByMethod(String classPath, String method, T p){
        try {
            Class<?> clazzService = Class.forName(classPath);
            Object service = SpringContextUtils.getBean(clazzService);
            Method pageMethod = clazzService.getMethod(method, p.getClass());
            return pageMethod.invoke(service, p);
        } catch (Exception e) {
            return null;
        }
    }

}
